#ifndef __pBase_H
#define __pBase_H
#include <stdint.h>
#include "stm32f4xx.h" 

typedef union _ltoc_struct
{
	struct
		{
		u8 c1;
		u8 c2;
		}c;
	u16 l;
}ltoc_struct;

typedef union _ltoc32_struct
{
	struct
		{
		u8 c1;
		u8 c2;
		u8 c3;
		u8 c4;
		}c;
	u32 l;
}ltoc32_struct;

//typedef unsigned short    uint16_t;
typedef uint16_t flashAdd ;

uint8_t sumor(uint8_t len,uint8_t *buf);
void buffercpy(uint8_t *buffer1,uint8_t *buffer2,uint16_t len);
void bufferset(uint8_t *buffer,uint8_t v,uint16_t len);
void dat32tBuf(uint32_t dat, uint8_t *outBuf);
uint8_t buffercmp(uint8_t* buffer1, uint8_t* buffer2, uint16_t len);
extern void  bufferMove(uint8_t *buffer,uint8_t start ,uint8_t len);
extern uint8_t  XOR_Check(uint8_t  *item, uint16_t n);
extern  void  U16ToDecString(u16 Num, u8* Str);
extern void  U8ToDecString(u8 Num, u8* Str);
extern u16 WordHexToBCD(u16 num);
extern void UTL_HexToAsc(u8 *_d,u8 * _s,u8 d_len);
extern   u8  HexToBCD(u8 num);
extern u8  buffSearchChar(u8 *inBuf,u8 ch,u8 len);
u16  eU16endian (u8 *cl);
u32  eU32endian (u8 *cl);
void emSizeEndChange(u8 *inBuf,u8* outBuf,u8 len);
#endif

